<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- 理想视口的标准的写法 -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>公共样式</title>
    <link rel="stylesheet" href="../css/base.css ">
    <link rel="stylesheet" href="../lib/assets/css/amazeui.css">
    <link rel="stylesheet" href="../css/public.css">
    <link rel="stylesheet" href="../css/category.css">
</head>
<body>
    <!-- 头部 -->
    <header>
        <a href="#" class="header_logo ">
            <img src="../images/header_logo.png" alt="">
        </a>
        <a href="#" class="header_app">
            <img src="../images/header_app.png" alt="">
        </a>
    </header>
    <!-- 搜索框 --> 
    <div class="search">
        <input type="text" class="search_text" placeholder="请输入你想比价的商品">
        <input type="button" class="search_btn" value="搜索">
    </div> 
    <!-- 内容部分 -->
    <div class="buy_content">
            <section data-am-widget="accordion" class="am-accordion am-accordion-gapped" data-am-accordion='{  }'>

            </section>
        </div>
    <!-- 底部 -->
    <div class="foot_mod">
            <div class="foot_top">
                <a href="#">登录</a> <a href="#">注册</a> 
                <a href="#top" style="width: 40%; border: 0;">
                <img src="http://www.zuyushop.com/wap/images/top.jpg" width="15" height="15">返回顶部</a>
            </div>
        <div class="footer">
            <p>
                <a href="#">手机app下载</a>
                <a href="#">慢慢买手机版</a>
                --  掌上比价平台
            </p>
            <p>
                m.manmanbuy.com
            </p>
        </div>
    </div>
    <!-- 返回顶部 -->
    <div data-am-widget="gotop" class="am-gotop am-gotop-default" >
        <a href="#top" title="回到顶部">
            <span class="am-gotop-title">回到顶部</span>
              <i class="am-gotop-icon am-icon-chevron-up"></i>
        </a>
      </div>

</body>
</html>
<!-- <script src="../lib/assets/js/amazeui.js"></script> -->
<script type="text/template" id="cateTitleTPL">
    {{each arr val key}}
    <dl class="am-accordion-item" data-id="{{val.titleId}}">
            <dt class="am-accordion-title">
               {{val.title}}
            </dt>
            <dd class="am-accordion-bd am-collapse">
                <!-- 规避 Collapase 处理有 padding 的折叠内容计算计算有误问题， 加一个容器 -->
                <div class="am-accordion-content">

                </div>
            </dd>
    </dl>
    {{/each}}
</script>
<script type="text/template" id="cateContentTPL">
                {{each arr val key}}
                    <a href="./goodsList.html?categoryid={{val.categoryId}}">{{val.category}}</a>
                {{/each}}
</script>
<script src="../lib/zepto/zepto.js"></script>
<script src="../lib/arttemplate/template-web.js"></script>
<script src="../js/category.js"></script>
<!-- <script>
    // 载入页面
    $.get("http://193.112.55.79:9090/api/getcategorytitle",function(res){
        var html = template("cateTitleTPL",{arr:res.result});
        $('section').html(html);
    })
    // 点击事件
    $('section').on('click','dl',function(){
        var flag = $(this).attr("data-flag");
        $(this).attr("data-flag","1");
        // console.log(flag)
        var id = $(this).attr('data-id');
        var father = $(this).children("dd");
        var target = $(this).children("dd").children("div");
        $.get("http://193.112.55.79:9090/api/getcategory",{"titleid":id},function(res){
            var html = template("cateContentTPL",{arr:res.result});
                // console.log({arr:res.result});
               target.html(html);
               $('dl dd').css("display","none");
               if(flag==1){
                // console.log(123);
                father.css("display","none");
                $('dl').removeAttr('data-flag');
               }else{
                father.css("display","block");
               }
        })
    })
</script> -->